home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_riv_ambrapids1.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  64 lines

  1. # Jones 3D Cog Script
  2. #
  3. # RIV_AmbRapids1.cog
  4. #
  5. # [TRM]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. # ========================================================================================
  9.  
  10. symbols
  11.  
  12.     message        entered
  13.  
  14.     thing        soundPos0        nolink
  15.     thing        soundPos1        nolink
  16.     
  17.     sector      start_Amb1      linkID=1
  18.     
  19.     sector      stop_Amb1       linkID=0
  20.     sector      stop_Amb2       linkID=0
  21.     sector      stop_Amb3       linkID=0
  22.     
  23.     sound        snd_rapids=gen_waterfall_a.wav      local
  24.     
  25.     int         playing=0               local
  26.     int         channel0=0              local
  27.     int         channel1=0              local
  28.     
  29.     flex        min_Pos0=-1
  30.     flex        max_Pos0=-1
  31.     flex        min_Pos1=-1
  32.     flex        max_Pos1=-1
  33.     
  34. end
  35.  
  36. # ========================================================================================
  37.  
  38. code
  39.  
  40. entered:
  41.  
  42.     if((GetSenderID() == 1) && (playing == 0))
  43.     {
  44.         playing = 1;
  45.         
  46.         Sleep(Rand()+0.5);
  47.         channel0 = PlaySoundThing(snd_Rapids, soundPos0, 1.0, min_Pos0, max_Pos0, 0x0001);
  48.         Sleep(Rand()+0.5);
  49.         channel1 = PlaySoundThing(snd_Rapids, soundPos1, 1.0, min_Pos1, max_Pos1, 0x0001);
  50.     }
  51.     
  52.     if(GetSenderID() == 0)
  53.     {
  54.         playing = 0;
  55.         StopSound(channel0, 2.0);
  56.         StopSound(channel1, 2.0);
  57.     }
  58.     
  59.     return;
  60.  
  61. # ========================================================================================
  62.  
  63. end
  64.